/* 统一变量定义 */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --danger-color: #f72585;
    --success-color: #4cc9f0;
    --warning-color: #f39c12;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --modal-bg: rgba(0, 0, 0, 0.5);
}

/* 基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: var(--dark-color);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 600;
}

h2 {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

/* 页面布局 */
.sidebar-layout {
    display: flex;
    min-height: 100vh;
    background-color: #f5f7fa;
}

.sidebar {
    width: 250px;
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    height: 100%;
}

.sidebar .menu-item {
    display: block;
    padding: 15px;
    margin-bottom: 15px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease;
}

.sidebar .menu-item:hover {
    background-color: #2a3d8c;
}

.content {
    margin-left: 260px;
    padding: 30px;
    flex: 1;
    transition: margin-left 0.3s ease;
}

@media (max-width: 992px) {
    .sidebar {
        width: 200px;
    }

    .content {
        margin-left: 220px;
    }
}

@media (max-width: 768px) {
    .sidebar-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: static;
        box-shadow: none;
    }

    .content {
        margin-left: 0;
        padding: 15px;
    }
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition), transform 0.2s ease-in-out;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 16px;
}

.btn i {
    margin-right: 10px;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-4px);
}

.btn-info {
    background: linear-gradient(45deg, var(--accent-color), #3a86ff);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(45deg, #3a86ff, var(--accent-color));
    transform: translateY(-4px);
}

.btn-danger {
    background: linear-gradient(45deg, var(--danger-color), #b5179e);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(45deg, #b5179e, var(--danger-color));
    transform: translateY(-4px);
}

.btn-success {
    background: linear-gradient(45deg, var(--success-color), #388e3c);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(45deg, #388e3c, var(--success-color));
    transform: translateY(-4px);
}

.btn-warning {
    background: linear-gradient(45deg, var(--warning-color), #e67e22);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(45deg, #e67e22, var(--warning-color));
    transform: translateY(-4px);
}

.btn-secondary {
    background-color: var(--gray-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-4px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    background: #fff;
}

th, td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: var(--light-color);
}

tr:nth-child(odd):hover {
    background-color: #f1f1f1;
}

/* 表单控件 */
.form-control {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-size: 14px;
    margin-bottom: 12px;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
    outline: none;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* 搜索框 */
.search-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-group .form-control {
    flex: 1;
    margin-bottom: 0;
}

/* 卡片 */
.card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    width: 500px;
    max-width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    list-style: none;
}

.page-item {
    margin: 0 5px;
}

.page-link {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.page-link:hover {
    background-color: #f1f1f1;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #f8f9fa;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    th, td {
        padding: 10px 15px;
        font-size: 14px;
    }

    .search-group {
        flex-direction: column;
    }

    .btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    .modal-content {
        padding: 20px;
    }
}

/* 特殊状态 */
.selected {
    background-color: #e3f2fd !important;
}

.editing {
    background-color: #fff3cd !important;
}

.error-message {
    color: var(--danger-color);
    font-size: 12px;
    margin-top: -8px;
    margin-bottom: 10px;
    display: none;
}

.success-message {
    color: var(--success-color);
    font-size: 14px;
    margin-top: 10px;
}
/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition), transform 0.2s ease-in-out;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 14px;
    margin: 5px;
}

.btn i {
    margin-right: 10px;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-4px);
}

.btn-info {
    background: linear-gradient(45deg, var(--accent-color), #3a86ff);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(45deg, #3a86ff, var(--accent-color));
    transform: translateY(-4px);
}

.btn-danger {
    background: linear-gradient(45deg, var(--danger-color), #b5179e);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(45deg, #b5179e, var(--danger-color));
    transform: translateY(-4px);
}

.btn-success {
    background: linear-gradient(45deg, var(--success-color), #388e3c);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(45deg, #388e3c, var(--success-color));
    transform: translateY(-4px);
}

.btn-warning {
    background: linear-gradient(45deg, var(--warning-color), #e67e22);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(45deg, #e67e22, var(--warning-color));
    transform: translateY(-4px);
}

.btn-secondary {
    background-color: var(--gray-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-4px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 这个样式适配你页面的按钮 */
button {
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    margin: 5px;
    background-color: var(--primary-color);
    color: white;
    transition: 0.3s;
}

button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

